package com.genius.reservation.driver.service;

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.service.additional.update.impl.LambdaUpdateChainWrapper;
import com.genius.reservation.car.entity.CarInformation;
import com.genius.reservation.common.ResponseRule;
import com.genius.reservation.common.rabbitmq.RabbitMessageEntity;
import com.genius.reservation.driver.entity.DriverInformation;
import com.baomidou.mybatisplus.extension.service.IService;
import com.genius.reservation.evaluate.entity.EvaluateInformation;
import com.genius.reservation.plague.entity.PlagueInformation;
import com.genius.reservation.user.entity.UserInformation;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 司机信息表 服务类
 * </p>
 *
 * @author baomidou
 * @since 2022-05-26
 */
public interface IDriverInformationService extends IService<DriverInformation> {



    default DriverInformation addAndUp(DriverInformation driver){
        this.saveOrUpdate(driver);
        return driver;
    }


    DriverInformation newDriver(UserInformation user);

    default boolean bindCar(CarInformation car,String driver){
        return this.lambdaUpdate().eq(DriverInformation::getDriverNumber, driver).set(DriverInformation::getCarNumber, car.getCarNumber()).update();
    }

    ResponseRule selectDriver(String driverNumber);

    DriverInformation selectOneDriver(String driverNumber);
    List<DriverInformation> getList();

    ResponseRule arriveSubmit(String reservationNumber,Integer startCarId);
    ResponseRule unbind(String driverNumber);

    ResponseRule editDriver(DriverInformation driver);

    ResponseRule bindPlague(Map<String,String> body);

    ResponseRule setOut(String reservationNumber,Integer startCarId);

//    ResponseRule arrive(String reservationNumber);
//    void newMessage(RabbitMessageEntity obj);
//
//    ResponseRule getMessage(String receiveManagerNumber);
//
//    ResponseRule getAllMessage(String userNumber);

    ResponseRule evaluate(String receiverNumber,Integer startCarId ,Integer operationScore,Integer attitudeScore,String evaluateRemarks);


    ResponseRule bindSupplier(String driverNumber,String supplierCode);

    ResponseRule getDriverBySupplier(String supplierNumber);

    ResponseRule driverSubmit(Integer startCarId,String wxNumber, String carCode, String driverName, String phone, String setOutPlace, String[] carImg, String[] healthyImg,String startCarTime,String reservationNumber);
    ResponseRule driverEdit(Integer startCarId,String wxNumber, String carCode, String driverName, String phone, String setOutPlace, String[] carImg, String[] healthyImg);

    ResponseRule editDriverInformation(String wxNumber,String reservationNumber,String carCode, String driverName, String phone, String setOutPlace, String[] carImg, String[] healthyImg);
    ResponseRule getStartCarInformation(String reservationNumber);

    ResponseRule getStartCar(String startCarId);


}
